//
//  JsMenuViewVmM.m
//  JsUtilitySdk
//
//  Created by Gikki Ares on 2023/6/15.
//

#import "JsMenuItemVmM.h"
@interface JsMenuItemVmM(){
@public
	int mi_public2_sub;
@private
	int mi_private2_sub;
@protected
	int mi_protected2_sub;
}
@end

@interface JsMenuItemVmM() {
	int mi_StateCount;
	int mi_currentState;
}

@property(nonatomic,strong)NSArray * modelArray;
@property(nonatomic,strong)NSArray * styleArray;



@end


@implementation JsMenuItemVmM
@dynamic unselectedStyle;
- (int)currentState {
	return mi_currentState;
}
- (JsMenuItemStyle *)currentStyle {
	return self.styleArray[self.currentState];
}

- (instancetype)initWithTitle:(NSString *)title {
	if(self = [self initWithTitle:title imageUrl:nil]){
	}
	return self;
}
- (instancetype)initWithTitle:(NSString *)title imageName:(nullable NSString *)imageName {
	if(self == [super init]) {
		UIImage * image = [UIImage imageNamed:imageName];
		JsMenuItemModel * model = [JsMenuItemModel modelWithImage:image title:title];
		mi_StateCount = 1;
		NSArray * modelArray = @[model];
		self.modelArray = modelArray;
		self->mi_public = 1;
		self->mi_protected = 1;
	}
	return self;
}

- (instancetype)initWithTitle:(NSString *)title imageUrl:(nullable NSString *)imageUrl {
	if(self == [super init]) {
		JsMenuItemModel * model = [JsMenuItemModel modelWithImageUrl:imageUrl title:title];
		mi_StateCount = 1;
		NSArray * modelArray = @[model];
		self.modelArray = modelArray;
	}
	return self;
}


@end
